<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>首页</title>
    <script src="/mvc/script/vue.js"></script>
    <script src="/mvc/script/axios.min.js"></script>
</head>
<body>

<div id="app">
    <button @click="sendAjaxRequest()">发送异步请求</button>
</div>
<script>
    var vue = new Vue({
        "el":"#app",
        "methods":{
            sendAjaxRequest(){
                axios({
                    "method":"POST",
                    "url":"/mvc/hello/getAge"
                }).then(response => {
                    console.log(response.data)
                }).catch(error => {
                    console.log(error.response)
                })
            }
        }
    });
</script>


</body>
</html>